home *** CD-ROM | disk | FTP | other *** search
/ PC World Interactive 7 / PC World Interactive 7.iso / program / cprog.EXE / CMOS.C < prev    next >
C/C++ Source or Header  |  1995-09-27  |  1KB  |  30 lines

  1. #include <dos.h>
  2. #define UCHAR unsigned char
  3. char *drive[]={ "Not Installed.","360Kb.","1.2Mb.","720Kb.","1.44Mb.",};
  4.  
  5. UCHAR GetByte(UCHAR adr )
  6. {
  7.     outportb(0x70,adr);
  8.     return (inportb(0x71));
  9. }
  10.  
  11. void main()
  12. {
  13. UCHAR a,b,c;
  14.     printf("\n──────────CMOS report by Levent Yavaƒ.──────────\n");
  15.     a=GetByte(0xd);
  16.     b=GetByte(0xe);
  17.     c=GetByte(0x10);
  18.     printf("          CMOS checksum %s\n",(b&64) ? "failure.":"OK.");
  19.     printf("Equipment configuration %s\n",(b&32) ? "failure":"OK.");
  20.     printf("           CMOS battery %s\n",(a&64) ? "dead.":"OK.");
  21.     printf("      Real time battery %s\n",(b&128) ? "failure.":"OK.");
  22.     printf("              CMOS time %s\n",(b&4) ? "failure.":"OK.");
  23.     printf("               RAM size %s\n",(b&16) ? "failure.":"OK.");
  24.     printf("              Hard disk %s\n",(b&8) ? "failure.":"OK.");
  25.     printf("            First drive %s\n",drive[c>>4]);
  26.     printf("           Second drive %s\n",drive[c&0xf]);
  27.     printf("─────────────────────────────────────────────────\n");
  28.  
  29. }
  30.